#!/bin/bash
rm -rf ./node_modules
npm config set registry https://registry.npmmirror.com/
npm install pnpm -g
pnpm config set registry https://registry.npmmirror.com/
pnpm install
case $1 in
sso)
  npm run buildsso
  ;;
plain)
  npm run build
  ;;
*)
  exit 1
  ;;
esac
VER=`cat ./package.json|grep '\"version\":'|cut -d '\"' -f4`
dd=`date '+%y%m%d'`
VERSION=${VER}.${dd}.$1
echo "function getVersion(){return {version:'${VERSION}'}}" > build/version.js
tar -vzcf bimsui_vue3_${VERSION}.tar.gz dist/
